package com.infra.micro.id.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.infra.common.resp.PrintFriendliness;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@ApiModel(value = "IdTokenVO", description = "ID生成服务视图对象")
public class IdWorkerVO extends PrintFriendliness {
    @ApiModelProperty(name = "workerId", value = "ID生成服务ID", required = true)
    private Integer workerId;

    @ApiModelProperty(name = "ip", value = "ip", required = true)
    private String ip;

    @ApiModelProperty(name = "port", value = "port", required = true)
    private int port;

    @ApiModelProperty(name = "localhost", value = "localhost", required = true)
    private String localhost;

    @ApiModelProperty(name = "maxTimestamp", value = "最后一次心跳时间戳", required = true)
    private Long maxTimestamp;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "createTime", value = "记录创建时间")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "updateTime", value = "记录更新时间")
    private Date updateTime;

    public Integer getWorkerId() {
        return workerId;
    }

    public void setWorkerId(Integer workerId) {
        this.workerId = workerId;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getLocalhost() {
        return localhost;
    }

    public void setLocalhost(String localhost) {
        this.localhost = localhost;
    }

    public Long getMaxTimestamp() {
        return maxTimestamp;
    }

    public void setMaxTimestamp(Long maxTimestamp) {
        this.maxTimestamp = maxTimestamp;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
